﻿<%@ Page Language="C#" MasterPageFile="~/Provider/MasterPage.master" AutoEventWireup="true" CodeFile="Modify.aspx.cs" Inherits="Provider_Modify" Title="无标题页" %>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
        var template = '<span style="color:{0};">{1}</span>';

        var Shenhe = function (value) {
            if(value==0){return String.format(template,'red', '未审');}
            if(value==1){return String.format(template,'green', '同意');}
            if(value==2){return String.format(template,'blue', '退回');}
        }
    </script>
    <ext:Store ID="Store1" OnRefreshData="Store1_OnRefreshData" runat="server">
    <Reader>
        <ext:JsonReader ReaderID="id">
            <Fields>
                <ext:RecordField Name="id" Type="Int"></ext:RecordField>
                <ext:RecordField Name="providername" Type="String"></ext:RecordField>
                <ext:RecordField Name="devicename" Type="String"></ext:RecordField>
                <ext:RecordField Name="dept_master_status" Type="Int"></ext:RecordField>
                <ext:RecordField Name="office_master_status" Type="Int"></ext:RecordField>
                <ext:RecordField Name="tech_master_status" Type="Int"></ext:RecordField>
                <ext:RecordField Name="boss_status" Type="Int"></ext:RecordField>
                <ext:RecordField Name="intime" Type="Date"></ext:RecordField>                 
            </Fields>
        </ext:JsonReader>
    </Reader>
     <AutoLoadParams>
         <ext:Parameter Name="start" Mode="Raw" Value="0" />
         <ext:Parameter Name="limit" Mode="raw" Value="10" />
     </AutoLoadParams> 
    </ext:Store>
    <ext:Store ID="Store3"   runat="server">
        <Reader>
            <ext:JsonReader ReaderID="uID">
                <Fields>
                    <ext:RecordField Name="uID" Type="Int"></ext:RecordField>
                    <ext:RecordField Name="username" Type="String"></ext:RecordField>
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:ViewPort runat="server" ID="ViewPort1">
        <Body>
            <ext:ColumnLayout ID="ColumlayOut1" Split="true" FitHeight="true" runat="server">
                <Columns>
                    <ext:LayoutColumn ColumnWidth="0.5">
                        <ext:Panel ID="Panel1" Frame="true" runat="server">
                            <Body>
                                <ext:GridPanel ID="GridPanel1"  Frame="true" Height="500" StoreID="Store1" Title="退回的供应商诚信档案" runat="server">
                                    <ColumnModel>
                                        <Columns>
                                            <ext:Column ColumnID="id" DataIndex="id" Header="档案编号"></ext:Column>
                                            <ext:Column ColumnID="providername" DataIndex="providername" Header="供应商"></ext:Column>
                                            <ext:Column ColumnID="devicename" DataIndex="devicename" Header="设备名称"></ext:Column>
                                            <ext:Column ColumnID="dept_master_status" DataIndex="dept_master_status" Header="部门领导">
                                            <Renderer Fn="Shenhe" />
                                            </ext:Column>
                                            <ext:Column ColumnID="office_master_status" DataIndex="office_master_status" Header="办公室领导">
                                            <Renderer Fn="Shenhe" />
                                            </ext:Column>
                                            <ext:Column ColumnID="tech_master_status" DataIndex="tech_master_status" Header="生产技术部领导">
                                            <Renderer Fn="Shenhe" />
                                            </ext:Column>
                                            <ext:Column ColumnID="boss_status" DataIndex="boss_status" Header="公司领导">
                                            <Renderer Fn="Shenhe" />
                                            </ext:Column>
                                            <ext:Column ColumnID="intime" DataIndex="intime" Header="时间">
                                            <Renderer Fn="Ext.util.Format.dateRenderer('Y-m-d')" />
                                            </ext:Column>
                                            <ext:CommandColumn>
                                                <Commands>
                                                    <ext:GridCommand Text="删除" Icon="Delete"  CommandName="del">
                                                                                                            
                                                    </ext:GridCommand>
                                                </Commands>
                                            </ext:CommandColumn> 
                                        </Columns>
                                    </ColumnModel>
                                   <SelectionModel>
                                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
                                            <AjaxEvents>
                                                <RowSelect OnEvent="RowSelect" Buffer="250">
                                                    <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{FormPanel1}" />
                                                    <ExtraParams>
                                                        <%-- or can use params[2].id as value --%>
                                                        <ext:Parameter Name="id" Value="this.getSelected().id" Mode="Raw" /> 
                                                    </ExtraParams>
                                                </RowSelect>
                                            </AjaxEvents>
                                        </ext:RowSelectionModel>
                                    </SelectionModel>
                                     <AjaxEvents>
                                        <Command OnEvent="DeleteRow" >
                                        <Confirmation Title="确认信息" ConfirmRequest="true" Message="确认删除吗？"  />
                                            <ExtraParams>
                                                <ext:Parameter Name="id" Value="record.data.id" Mode="Raw">
                                                </ext:Parameter> 
                                            </ExtraParams>
                                        </Command>
                                     </AjaxEvents>
                                    <BottomBar>
                                        <ext:PagingToolBar 
                                            ID="PagingToolBar1" 
                                            runat="server" 
                                            PageSize="10" 
                                            StoreID="Store1" 
                                            />
                                    </BottomBar>
                                    <LoadMask ShowMask="true" />
                                </ext:GridPanel>
                            </Body>
                        </ext:Panel>
                    </ext:LayoutColumn>
                    <ext:LayoutColumn ColumnWidth="0.5">
                        <ext:Panel ID="Panel2" Frame="true" AutoScroll="true"  runat="server" >
                            <Body>
                            <ext:FormPanel ID="FormPanel1" AutoScroll="true" runat="server" BodyStyle="padding:5px;" ButtonAlign="Right"
                                    Frame="true"  >
                                    <Body>
                                 <ext:FormLayout ID="FormLayout1" runat="server">
                                        <ext:Anchor>
                                            <ext:Hidden ID="tfid" runat="server"></ext:Hidden>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:Hidden ID="tfguid" runat="server"></ext:Hidden>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:TextField ID="TfProviderName" runat="server" FieldLabel="供应商名称">
                                            </ext:TextField>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:TextField ID="TfDeviceName" runat="server" FieldLabel="供应设备名称">
                                            </ext:TextField>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:DateField ID="tfsham_time" runat="server" FieldLabel="提供虚假材料时间"></ext:DateField>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:TextField ID="tfsham_project" runat="server" FieldLabel="提供虚假材料项目" ></ext:TextField>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:TextArea Width="350" FieldLabel="提供虚假材料具体情况" ID="tfshame_detail" runat="server">
                                            </ext:TextArea>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                              <ext:DateField ID="tfxinghu_time" runat="server" FieldLabel="行贿时间"></ext:DateField>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:TextField ID="tfxinghu_project" runat="server" FieldLabel="行贿项目" ></ext:TextField>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:TextArea Width="350" ID="tfxinghui_detail" runat="server" FieldLabel="行贿详细" ></ext:TextArea>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:DateField ID="tfcontract_time" runat="server" FieldLabel="违约时间" ></ext:DateField>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:TextField ID="tfcontract_project" runat="server" FieldLabel="违约项目" ></ext:TextField>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:TextArea Width="350"  ID="tfcontract_detail" runat="server" FieldLabel="违约情况" ></ext:TextArea>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:TextArea Width="350" ID="tfother_detail" runat="server" FieldLabel="其他情况" ></ext:TextArea>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:ComboBox runat="server" StoreID="Store3" EmptyText="请选择" Disabled="true" Editable="false" ID="tfdept_master_id" DisplayField="username"       ValueField="uID" FieldLabel="部门领导"></ext:ComboBox>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:FileUploadField ID="tffileupload" runat="server" FieldLabel="附件上传" Width="200"  Icon="Attach"></ext:FileUploadField>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:Label ID="Label2" runat="server" FieldLabel="注意" Text="如果有支持以上各项评价的相关证明文件请统一打包压缩作为附件上传，方便审核。<br>建议以说明性文字作为附件文件名。为节约服务器空间，附件仅支持.zip和.rar文件格式"></ext:Label>
                                        </ext:Anchor>
                                </ext:FormLayout>
                                    </Body>
                                    <Buttons>
                                        <ext:Button ID="Button1" runat="server" Icon="Disk" Text="提交">
                                        <AjaxEvents>
                                            <Click OnEvent="SubmitForm"></Click>
                                        </AjaxEvents>
                                        </ext:Button>
                                    </Buttons>
                                </ext:FormPanel>
                            </Body>
                        </ext:Panel>
                    </ext:LayoutColumn>
                </Columns>
            </ext:ColumnLayout>
        </Body>
    </ext:ViewPort>
</asp:Content>

